@extends('mobile_end.layouts.default')
{{-- content_header --}}

@section('container')

<div class="ui-navigator">
    <div class="carttop"><i class="icon-shopping-cart icon-2x"></i> 订单详情</div>
</div>
<ul class="detail-list">
    <li><h1>总计： ￥ {{ $order->total_price }} 元 </h1></li>
    <li><h1>状态：{{ Order::$statuses[$order->status]['display_name'] }} </h1></li>
    <li> 更新时间: {{ $order->updated_at }}</li>
    <li>
        <ul class="cartlist">

            @foreach($order->orderFoods as $entry)
            @include('mobile_end.layouts._order_food_list_li', array('entry'=>$entry))
            @endforeach

        </ul>
    </li>
    <li><h1>二维码(靠近自助设备打印订单时使用)</h1></li>
    <li>
        <br/>
        {{ $order->getQRCode() }}
        <br/>
    </li>

</ul>
<!-- 判断该订单是否已结算，如果已经结算，则隐藏结算按钮 -->
@if($order->status !== Order::getStatusIDByKeyword(Order::SETTLED))
<div class="cartdiv tdright">
    @if(!$isIntegralEnough)
    <span class="show-integral-no-enough"><i class="fa fa-check"></i>&nbsp;您的积分不足</span>
    @endif
    <span class="button-wrap" style="margin: 6px;">
        <a @if($isIntegralEnough) href="{{ URL::action('MobileOrderController@doSettleByIntegral', $order->id) }}" @endif
           class="button button-block button-pill button-large button-highlight @if(!$isIntegralEnough) disabled @endif">
            使用{{ $order->getIntegralPrice() }}积分结算
        </a>
    </span>
</div>
@endif

<div class="cartdiv tdright">
@if($order->status == Order::getStatusIDByKeyword(Order::GOT_ORDER  ))

    @if(!$isIntegralEnough)
    <span class="show-integral-no-enough"><i class="fa fa-check"></i>&nbsp;您的积分不足</span>
    @endif
    <span class="button-wrap" style="margin: 6px;">
        <a @if($isIntegralEnough) href="{{ URL::action('MobileOrderController@doSettleByIntegral', $order->id) }}" @endif
           class="button button-block button-pill button-large button-highlight @if(!$isIntegralEnough) disabled @endif">
            使用{{ $order->getIntegralPrice() }}积分结算
        </a>
    </span>
    <span class="button-wrap" style="margin: 6px;">
            <a href="{{URL::to('mobile_ali_pay?order_id='.$order->id)}}" class="button button-block button-pill button-large button-highlight">
                使用支付宝结算
            </a>
     </span>
@endif

</div>


<div class="cartdiv tdright"> <span class="button-wrap"> <a  onclick="window.history.go(-1)" class="button button-block button-pill button-tiny button-primary"><i class="icon-reply"></i>返回</a> </span> </div>

@stop
